const {ccclass, property,menu} = cc._decorator;

@ccclass
@menu('VM/VM-LABEL')
export default class test extends cc.Label {

    setObserveValue(obj:any,op:string,callback:(newVal: any, oldVal: any)=>void){

        let oldVal = obj[op];
        Object.defineProperty(obj,op , {
            get: function () {
                return oldVal;
            },
            set: function (newVal) {
                if (oldVal !== newVal) {
                    callback(newVal,oldVal)
                    oldVal = newVal
                }
            }
        })
    }

    // update (dt) {}
}
